/* Basics */
html {
    padding-left: 6.8em;
    padding-right: 6.8em;  /* It would be nice to have this collapse as the window gets small. */
}
body {
    margin: 0 auto;
    max-width: 800px;
    background-color: #fdfdfc;
    color: #333333;
    font-family: Cambria, Palatino Linotype, Palatino, Liberation Serif,
        serif;
    font-size: 17px;
    line-height: 135%;
}
section { display: block; }
h1 { line-height: normal; }
body > section { margin-top: 5em; }
body > section > section { margin-top: 4em; }
body > section > section section { margin-top: 2.5em; }
body > .inner-title {
    font-size: 160%;
    font-weight: bold;
    margin-top: 6em;
}
body section h1 {
    font-size: 110%;
    margin-bottom: 0.8em;
    padding-bottom: 0.2em;
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #fdfdfc;
    box-shadow: 0 0 6px #fdfdfc;
    margin-left: -7em;
    padding-left: 7em;
}
body > hgroup > h1 { font-size: 150%; margin-top: 0; margin-bottom: 0; }
h1 span.secnum {
    width: 6em;
    margin-left: -6.8em;
    text-align: right;
    float: left;
}
h2 { font-size: 100%; margin-bottom: 1em; }

h1 > span.section-status { display: block; }

section > p, div > p {
    text-align: justify;
}

b, em.jargon-first-use, span.this, span.value, span.libname,
span.errorname, code, pre {
    color: #555555;
    font-weight: bold;
}

p.normalbefore {
    margin-bottom: 0em;
}

code, pre, .string.value { font-family: "Courier New", monospace; }
code, .string, .math { white-space: nowrap; }

sup, sub {
    font-size: smaller;
    vertical-align: baseline;  /* Make sup and sub not affect line height. */
    position: relative;
}
sup { bottom:  0.3em; }
sub { bottom: -0.3em; }
.gp sub, .prod sub, sub.gopt {  /* Specifically for "opt". */
    font-size: 65%;
}

pre {
    margin-left: 2em;
    font-size: 85%;
}
div.math-display {
    margin-left: 4em;
}

a:link {
    text-decoration: none;
    color: #3333bb;
}
a:hover {
    text-decoration: underline;
    color: blue;
}
a:link b, a:link span.value, a:link span.this,
a:link span.libname, a:link span.errorname, a:link code {
    color: #5555bb;
}
a:hover b, a:hover span.value, a:hover span.this,
a:hover span.libname, a:hover span.errorname, a:hover code {
    color: #0000ee;
}
a:visited b, a:visited span.value, a:visited span.this,
a:visited span.libname, a:visited span.errorname, a:visited code {
    color: inherit;
}
span.secnum a:link, span.secnum a:visited { color: inherit; }
h1:hover span.secnum a:link, h1:hover span.secnum a:visited {
    color:#5555bb;
    text-decoration: underline;
}
.toc span.secnum a:link, .toc span.secnum a:visited {
    color:#5555bb;
}

em { font-style: italic; }
p.formal-reference { margin-left: 3em; text-indent: -1em; }
span.book-title { font-style: italic; }
span.abstractopname { font-style: italic; }
span.typename { font-style: italic; }
span.typecombinator { font-style: italic; }
dfn { font-style: italic; }

div.blank-page:after {
    content: '\0000a0';
    clear: both;
    margin-bottom: 1em;
}

/* Front matter */
ol.toc { padding-left: 0; }
ol.toc > li { list-style-type: none; padding-left: 1em; text-indent: -1em;}
ol.toc > li span.secnum {
    float: none;
}
#unofficial {
    margin: 4em 0;
    background-color: #eed4bb;
    border-radius: 6px;
    padding: 2em 4em;
}
#ecma-disclaimer {
    font-style: italic;
    border: 1px solid;
    margin: 2em 0 3em 0;
}
.stern.warning {
    font-weight: bold;
    text-transform: uppercase;
}

p.ECMAaddress { margin-bottom: 0em; margin-top: 0em; }

p.normalBullet {
	margin-left: 4em;
	text-indent: -1.7em;
	margin-top: 0em;
	margin-bottom: 0.25em;
}
p.normalBulletSubstep {
	margin-left: 6em;
	text-indent: -1em;
	margin-top: 0em;
	margin-bottom: 0.25em;
}


pre.NoteCode { margin-bottom: 0em; margin-top: 0em; }

/* Notes */
div.note {
    margin: 1em 0 1em 6em;
}
span.nh {
    float: left;
    width: 6em;
    margin-left: -6em;
}

/* Figures and tables */
figure { display: block; margin: 1em 0 3em 0; }
figure object { display: block; margin: 0 auto; }
figure table.real-table { margin: 0 auto; }
figure figcaption {
    display: block;
    color: #555555;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.25em;

}
figcaption :target {
    /* When a user visits #table-1, slide the caption down
       so it won't be obscured by a sticky heading (issue #73).
       Thanks to Claude Pache for this "nasty trick" (his words). */
    display: inline-block;
    padding-top: 2em;
    margin-top: -2em;
}

table.real-table {
    border-collapse: collapse;
}
table.real-table td, table.real-table th {
    border: 1px solid black;
    padding: 0.4em;
    vertical-align: baseline;
}
table.real-table th {
    background-color: #eeeeee;
}

/* Note: the left content edges of table.lightweight-table >tbody >tr >td
   and div.display line up. */
table.lightweight-table {
    border-collapse: collapse;
    margin: 0 0 0 1.5em;
}
table.lightweight-table td, table.lightweight-table th {
    border: none;
    padding: 0 0.5em;
    vertical-align: baseline;
}
div.display { margin: 1em 0 1em 2em; }

/* Grammar productions */
div.gp { margin-left: 2.4em; margin-top: 0.9em; }
div.gp.prod { margin-left: 0; }  /* one-line production */
div.rhs { margin-left: 2.4em; margin-right: -10em; }  /* right-hand side */
div.pile { margin-left: 2.4em; max-width: 40em; }
div.keyword.pile code { float: left; width: 25%; }
div.keyword5.pile code { float: left; width: 20%; }
div.operator.pile code { float: left; width: 16%; }
div.end-pile { clear: both; }
sub.g-opt { color: #d1009e; /* sort of magenta */ }
sub.g-params { color: #49a08a; /* sort of aqua */ }

code { /* including code.t, meaning "terminal" or "token" */
    font-weight: bold;
    color: #555555;
}
span.nt {  /* nonterminal */
    font-family: Times New Roman, Times, FreeSerif, serif;
    font-style: italic;
}
span.geq { font-weight: bold; }  /* grammar equal-sign, like "::" */
span.grhsmod {  /* right-hand side modifier, like "one of", "but not" */
    font-weight: bold;
    color: #555555;
}
span.grhsannot {   /* right-hand side annotation, like "[empty]" */
    font-family: Helvetica, Arial, Liberation Sans, sans-serif;
    font-size: smaller;
}
span.chgloss {  /* gloss for a character, like "asterisk" */
    font-style: italic;
}
span.gprose {
    font-family: Helvetica, Arial, Liberation Sans, sans-serif;
    font-size: 90%;
}

div.gsumxref {     /* grammar summary cross-reference, used in Annex A */
    width: 8em;
    float: right;
}

span.prod { margin-left: 5pt; margin-right: 5pt; }

div.rhs > code.t,
div.rhs > span.nt,
div.rhs > span.grhsannot,
div.rhs > span.grhsmod,
div.rhs > span.chgloss,
div.rhs > span.gprose,
div.rhs > var,
.prod > span.geq,
.prod > code.t,
.prod > span.nt,
.prod > span.grhsannot,
.prod > span.grhsmod,
.prod > span.chgloss,
.prod > span.gprose,
div.rhs > var {
    margin-left: 5pt;
}

div.rhs > code.t:first-child,
div.rhs > span.nt:first-child,
div.rhs > span.grhsannot:first-child,
div.rhs > span.grhsmod:first-child,
div.rhs > span.chgloss:first-child,
div.rhs > span.gprose:first-child,
div.rhs > var:first-child,
.prod > span.geq:first-child,
.prod > code.t:first-child,
.prod > span.nt:first-child,
.prod > span.grhsannot:first-child,
.prod > span.grhsmod:first-child,
.prod > span.chprose:first-child,
.prod > span.gprose:first-child,
.prod > var:first-child {
    margin-left: 0;
}

ul > li { list-style-type: disc; }
ul > li  > p { margin-bottom: 0.25em; margin-top: 0em; }


/* Procedures */
ol.proc {margin-top: 0.5em;}
ol.proc > li { list-style-type: decimal; }
ol.proc > li > ol.block > li { list-style-type: lower-latin; }
ol.proc > li > ol.block > li > ol.block > li
  { list-style-type: lower-roman; }
ol.proc > li > ol.block > li > ol.block > li >
  ol.block > li { list-style-type: decimal; }
ol.proc > li > ol.block > li > ol.block > li >
  ol.block > li > ol.block > li { list-style-type: lower-latin; }
ol.proc > li > ol.block > li > ol.block > li >
  ol.block > li > ol.block > li > ol.block > li
  { list-style-type: lower-roman; }
  
/* special indents for replacement steps*/
p.special1 { padding-left: +3em; ;text-indent: -1em; }
p.special2 { padding-left: +11em; ;text-indent: -1em; }
p.special3 { padding-left: +6em; ;text-indent: -1em; }
p.special4 { padding-left: +3em; ;text-indent: -1em; }

/* Bibliography */
ol.bibliography { margin-left: 0; }
ol.bibliography > li {
    margin-left: 3em; list-style-type: none; margin-bottom: 1.1em; }
ol.bibliography > li > span.num {
    float: left; margin-left: -3em; width: 2.5em; text-align: right; }

@media print {
    html {
        padding-left: 0;
        padding-right: 0;
    }

    body {
        max-width: none;
        background-color: transparent;
        color: black;
        font-size: 10pt;
        line-height: inherit;
    }

    h1 span.secnum {
        width: auto;
        margin-left: 0;
        text-align: inherit;
        float: none;
    }

    a:link, a:visited {
        color: inherit;
        text-decoration: none;
    }

    code, pre, span.errorname, span.grhsmod,
    a:link b, a:link span.value, a:link span.this,
    a:link span.libname, a:link span.errorname, a:link code,
    a:visited b, a:visited span.value, a:visited span.this,
    a:visited span.libname, a:visited span.errorname, a:visited code,
    .toc span.secnum a:link, .toc span.secnum a:visited,
    figure figcaption {
        color: inherit;
    }

    table.real-table td, table.real-table th {
        border: 0.2pt solid black;
    }

    div.note {
        font-size: 9pt;
    }

    @page :left {
        margin-top: 1.25in;
        margin-bottom: 0.375in;
        margin-left: 0.5in;
        margin-right: 1.0in;
    }

    @page :right {
        margin-top: 1.25in;
        margin-bottom: 0.375in;
        margin-left: 1.0in;
        margin-right: 0.5in;
    }
}
